<?php
/**
 * Created by PhpStorm.
 * User: sl
 * Date: 17-8-1
 * Time: 下午4:42
 */

namespace ActionsHttp;


use Data\Order_form_DAO;

class RestaurantNowStatistics extends BaseActionHttp
{
    public function doAction() {
        parent::doAction();
        // 商铺id
        $restaurant_id = $_SESSION[RESTAURANT_ID];
        $restaurant_id = 1;

        // 今日日期
        $date = $this->data[DATE];
        // 今日营业
        $statistics_info = Order_form_DAO::getSumTotalPrice($restaurant_id,$date);
        if (!$statistics_info) {
            return $this->SendErrMsg("没有数据");
        }
//        // 营业额
//        $turnover = $statistics_info[TURNOVER];
//        // 订单数量
//        $total_food_count = $statistics_info[TOTAL_FOOD_COUNT];
//        // 顾客数量
//        $cusumer_count = $statistics_info[CUSUMOR_COUNT];


        // 返回数据
        $this->setValue(STATISTICS_INFO,$statistics_info);
        $this->ResponseDataToCurrentClient();
    }
}